home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1071 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  4.2 KB

  1. Subject: dev mtime, filesys.h, virtual console patch
  2. Date: Sat, 19 Feb 94 2:22:44 CET
  3. From: Juergen Lock <nox@jelal.north.de>
  4. In-Reply-To: <199402171855.AA05725@techfac.TechFak.Uni-Bielefeld.DE>; from "Torsten Scherer" at Feb 17, 94 5:17 pm
  5. Message-Id: <9402190122.AA00202@jelal.north.de>
  6.  
  7. Torsten Scherer writes:
  8.  
  9. > diff -u4 orig/dos.c ./dos.c
  10. >...
  11. > --- cut cut cut ---
  12. >  Otherwise most of the /dev entires look a bit stupid, with 1980 as the year
  13. > of their creation and use and so...
  14.  
  15.  btw to support the date stuff in device drivers some updated version of
  16. filesys.h would be useful... (or should i hack a perlscript to make one
  17. from file.h? :)
  18.  
  19.  anyway, link 1.10 file.h to filesys.h for now.  the first patch is a hack
  20. for the gemini TIOCGWINSZ problem (sigh why don't people use ptys...) and
  21. the rest is for the atime/mtimes.
  22.  
  23. Index: vtdev.c
  24. @@ -1138,6 +1138,10 @@
  25.      screen_datime, screen_close, screen_select, screen_unselect
  26.  };
  27.  
  28. +#ifdef VT00XCON
  29. +static long xconout_start;
  30. +#endif
  31. +
  32.  static long ARGS_ON_STACK 
  33.  screen_open(f)
  34.      FILEPTR *f;
  35. @@ -1148,7 +1152,7 @@
  36.      if (!rowoff) {
  37.  #ifdef VT00XCON
  38.          /* if vt00 should write thru xconout be sure its there :) */
  39. -        if (!xconout[CONDEV])
  40. +        if (!(xconout_start = xconout[CONDEV]))
  41.              return -EINTERNAL;
  42.  #endif
  43.          if ((fd = init()))
  44. @@ -1350,6 +1373,14 @@
  45.          w = (struct winsize *)buf;
  46.          w->ws_row = v->maxy+1;
  47.          w->ws_col = v->maxx+1;
  48. +#ifdef VT00XCON
  49. +    /* another compatibility hack for those `never heared of ptys'
  50. +       GEM programs:  if the vector changed since we started the
  51. +       console size is `unknown'...
  52. +    */
  53. +        if (!vt && xconout[CONDEV] != xconout_start)
  54. +            w->ws_row = w->ws_col = 0;
  55. +#endif
  56.      }
  57.  #ifdef VT00XCON
  58.      else if (vt && mode >= TCURSOFF && mode <= TCURSGRATE)
  59.  
  60. Index: vcon.h
  61. @@ -1,5 +1,3 @@
  62. -#include "filesys.h"
  63. -
  64.  #ifdef __GNUC__
  65.  #define EXITING volatile    /* function never returns */
  66.  #else
  67. @@ -10,8 +8,12 @@
  68.  #ifdef __TURBOC__
  69.  #define ARGS_ON_STACK cdecl
  70.  #else
  71. +#ifdef __CDECL
  72. +#define ARGS_ON_STACK __CDECL
  73. +#else
  74.  #define ARGS_ON_STACK
  75.  #endif
  76. +#endif
  77.  
  78.  /* define to indicate unused variables */
  79.  #ifdef __TURBOC__
  80. @@ -20,6 +22,19 @@
  81.  #define UNUSED(x)
  82.  #endif
  83.  
  84. +#ifndef P_
  85. +# ifdef __STDC__
  86. +#  define P_(x) x
  87. +# else
  88. +#  define P_(x) ()
  89. +# endif
  90. +#endif
  91. +
  92. +#define ushort    unsigned short
  93. +typedef long (*Func)();
  94. +
  95. +#include "filesys.h"
  96. +
  97.  #define CTRL(x) ((x) & 0x1f)
  98.  #ifndef T_NOFLSH
  99.  #define T_NOFLSH    0x0040        /* don't flush buffer when signals
  100. Index: vtdev.c
  101. @@ -1214,7 +1218,7 @@
  102.      return 0;
  103.  }
  104.  
  105. -#define _hz_200 (*((long *)0x4baL))
  106. +#define _hz_200 (*((unsigned long *)0x4baL))
  107.  
  108.  static long ARGS_ON_STACK 
  109.  screen_write(f, buf, bytes)
  110. @@ -1225,7 +1229,10 @@
  111.      long *r;
  112.      long ret = 0;
  113.      int c;
  114. -    long tick;
  115. +    unsigned long tick;
  116. +    static unsigned long lastw;
  117. +    static int lastv;
  118. +    extern int __mint;
  119.  
  120.      /* tty_write is calling us with no more than one line or 128
  121.         chars at a time but still never(?) allows task-switches
  122. @@ -1298,6 +1305,14 @@
  123.      if (tick != _hz_200 && !(tick & 3))
  124.          yield();
  125.  #endif
  126. +    if (ret > 0 && (vt != lastv || (_hz_200 - lastw) >= 100) &&
  127. +        __mint > 0x109) {
  128. +        struct bios_file *b = (struct bios_file *)f->fc.index;
  129. +        lastw = _hz_200;
  130. +        lastv = vt;
  131. +        b->xattr.atime = b->xattr.mtime = TGETTIME();
  132. +        b->xattr.adate = b->xattr.mdate = TGETDATE();
  133. +    }
  134.      return ret;
  135.  }
  136.  
  137. @@ -1306,10 +1321,18 @@
  138.      FILEPTR *f; char *buf; long bytes;
  139.  {
  140.      int vt = f->fc.aux;
  141. +    long ret;
  142. +    extern int __mint;
  143.  
  144.      if ((f->flags & O_NDELAY) != q_fl[vt])
  145.          FCNTL (qfd[vt], (long)(q_fl[vt] = f->flags&O_NDELAY), F_SETFL);
  146. -    return FREAD (qfd[vt], bytes, buf);
  147. +    ret = FREAD (qfd[vt], bytes, buf);
  148. +    if (ret > 0 && __mint > 0x109) {
  149. +        struct bios_file *b = (struct bios_file *)f->fc.index;
  150. +        b->xattr.atime = TGETTIME();
  151. +        b->xattr.adate = TGETDATE();
  152. +    }
  153. +    return ret;
  154.  }
  155.  
  156.  static long ARGS_ON_STACK 
  157. Index: vtdev.h
  158. @@ -1,4 +1,6 @@
  159.  /* kernel calls... */
  160. +#define TGETDATE    (*kernel->dos_tab[0x2a])
  161. +#define TGETTIME    (*kernel->dos_tab[0x2c])
  162.  #define FOPEN    (*kernel->dos_tab[0x3d])
  163.  #define FCLOSE    (*kernel->dos_tab[0x3e])
  164.  #define FREAD    (*kernel->dos_tab[0x3f])
  165. -- 
  166. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  167.                                 ...ohne Gewehr
  168. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  169.